/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package groupchooser;

import java.util.ArrayList;

/**
 *
 * @author Bartal Clementsen
 */
public class Group {
    int number;
    ArrayList<Student> studentList;
    
    public Group(int number)
    {
        studentList = new ArrayList<>();
        this.number = number;
    }
    
    public void addStudent(Student s)
    {
        studentList.add(s);
    }
    
    public void removeStudent(Student s)
    {
        studentList.remove(s);
    }
    
    public void removeStudent(int number)
    {
        studentList.remove(number);
    }
    
    public String getString()
    {
        String returnString = "";
        returnString += "Bólkur " + number + "\n";
        int index = 1;
        for(Student s : studentList)
        {
            returnString += "  " + index + ". " + s.firstName + "\n";
            index++;
        }
        
        return returnString;
    }
}
